import React from "react";
import { PropTypes } from "prop-types";
import { StyleSheet, View, Button } from "react-native";
import { StackNavigator } from "react-navigation";

class ChatScreen extends React.Component {
  static propTypes = {
    navigation: PropTypes.object.isRequired
  };

  static navigationOptions = {
    title: "Chat"
  };

  render() {
    return (
      <View style={styles.wrapper}>
        <Button
          title="Go to Details"
          onPress={() => this.props.navigation.navigate("Details")}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  wrapper: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center"
  }
});

const ChatStack = StackNavigator({
  Chat: { screen: ChatScreen }
});

export default ChatStack;
